import java.util.*;
import java.io.*;

public class test {
    public static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static Read in = new Read();
    //蓝桥杯 数组分割(⭐⭐⭐⭐)
    public static void main(String[] args) throws IOException{
        int t = in.nextInt();
        while(t-- > 0) {
            int n = in.nextInt();
            int[] nums = new int[n];
            int sum = 0;
            for(int i = 0;i < n;i++) {
                nums[i] = in.nextInt();
                sum += nums[i];
            }
            //sum为奇数,不存在均分为偶数组合的情况
            if(sum % 2 != 0) {
                System.out.println(0);
                continue;
            }
            //如: 0 1 2 3 4 5 6 7 8 9 10 11
            //只要找出一个和为偶数的子序列,另一个补集的和自然也就为偶数
            //所以就转变成了"找和为偶数的子序列有多少"
            //dp代表前i个元素中,对2取余为0或1的子序列个数

            //1.创建dp表
            long[][] dp = new long[n + 5][2];
            //2.初始化
            dp[0][0] = 1;
            dp[0][1] = 0;
            // 1 2 3 4 5
            //3.填表
            for(int i = 1;i <= n;i++) {
                //如果i为偶数
                if(nums[i - 1] % 2 == 0) {
                    //选
                    dp[i][0] = (dp[i-1][0] * 2) % 1000000007;
                    dp[i][1] = (dp[i-1][1] * 2) % 1000000007;
                }else {
                    dp[i][0] = (dp[i-1][1] + dp[i-1][0]) % 1000000007;
                    dp[i][1] = (dp[i-1][0] + dp[i-1][1]) % 1000000007;
                }
            }
            //4.返回值
            System.out.println(dp[n][0]);
        }
    }
    //蓝桥杯 蜗牛(⭐⭐⭐⭐)
    public static void main() throws IOException {
        //n个竹竿
        int n = in.nextInt();
        //[i][0]为该竹竿的根
        //[i][1]为该竹竿的传送门高度
        int[] arr = new int[n + 5];
        int[] a = new int[n + 5];
        int[] b = new int[n + 5];
        for(int i = 1;i <= n;i++){
            //竹竿的根的x
            arr[i] = in.nextInt();
        }
        for(int i = 1;i < n;i++){
            //该竹子传送门高度(终点)
            a[i] = in.nextInt();
            //到达下一个竹子的高度(新起点)
            b[i + 1] = in.nextInt();
        }
        double[][] dp = new double[n + 1][2];
        //[0]代表走到竹子底,[1]代表走到传送门
        //走到第1个竹子所需要的最短时间
        dp[1][0] = arr[1] * 1.0;
        dp[1][1] = arr[1] * 1.0 + a[1] / 0.7;
        for(int i = 2;i <= n;i++){
            //传送门的位置在上次传送过来的上面
            if(a[i] > b[i]){
                dp[i][1] = Math.min(dp[i - 1][1] + (1.0 * a[i] - b[i]) / 0.7,
                        dp[i - 1][0] + (1.0 * arr[i] - 1.0 * arr[i-1]) + 1.0 * a[i] / 0.7);
            }else {
                dp[i][1] = Math.min(dp[i - 1][1] + (1.0 * b[i] - a[i]) / 1.3,
                        dp[i - 1][0] + (1.0 * arr[i] - 1.0 * arr[i-1]) + 1.0 * a[i] / 0.7);
            }
            dp[i][0] = Math.min(dp[i - 1][1] + (1.0 * b[i]) / 1.3,dp[i - 1][0] + (1.0 * arr[i] - arr[i - 1]));
        }
        System.out.printf("%.2f",Math.min(dp[n][0],dp[n][1]));
    }
    //蓝桥杯 买二赠一(⭐⭐⭐)
    public static int[] buys;
    public static void main1() throws IOException{
        int n = in.nextInt();
        int[] arr = new int[n + 1];
        buys = new int[n + 1];
        //记录商品是否免费获得过
        //记录当前的最大价格商品
        int buy = 0;
        int k = n;
        for(int i = 1;i <= n;i++) {
            arr[i] = in.nextInt();
        }
        Arrays.sort(arr);
        for(int i = n;i >= 1;i--) {
            if(buys[i] == 1) {
                continue;
            }
            buy++;
            //代表购买两次商品,可选择免费商品
            if(buy % 2 == 0) {
                int maxPrice = arr[i] / 2;
                // 1. 当前免费范围合法
                // 2. 当前商品k的价格大于最大可购买的商品价格
                // 3. 或者当前商品k已经被免费购买过了
                while(k >= 1 && (arr[k] > maxPrice || buys[k] == 1)) {
                    k--;
                }
                if(k < 1) {
                    break;
                }else {
                    buys[k] = 1;
                    k--;
                }
            }
        }
        long sum = 0;
        for(int i = 1;i <= n;i++) {
            sum += buys[i] == 0 ? arr[i] : 0;
        }
        System.out.println(sum);
    }
}
class Read{
    StringTokenizer st = new StringTokenizer("");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String next() throws IOException{
        while(!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    int nextInt() throws IOException{
        return Integer.parseInt(next());
    }
    long nextLong() throws IOException{
        return Long.parseLong(next());
    }
    double nextDouble() throws IOException{
        return Double.parseDouble(next());
    }
}
